<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<html>
<head>
<meta charset="UTF-8">
<meta name="copyright" content="Tencent" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title></title>
<link href="<%=path%>/favicon.ico" rel="shortcut icon">
<link href="https://cdn.jsdelivr.net/gh/bootcdn/BootCDN/ajax/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/marketing/public.css" />
<link rel="stylesheet" href="<%=path%>/css/marketing/animation.css">
	<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/marketing/activity.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/marketing/marketing.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/marketing/public.css" />
<link rel="stylesheet" href="<%=path%>/css/marketing/index.css"/>	

<link rel="stylesheet" type="text/css" href="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.css">
</head>
<body>
    <div hidden="" style='margin:0 auto;width:0px;height:0px;overflow:hidden;'>
       <img id="sharePic" src="" width='700'>
    </div>
    <p hidden="" id="shareContent"></p>
	<section class="slider-nav" id="sliderNav">
		<section class="sliderWrap" id="sliderWrap">
			<section class="page page1">
				<div id="page1">
					<p class="aaa">
						<img src="<%=path%>/images/marketing/1.png" />
					</p>
					<p class="bbb">
						<img src="<%=path%>/images/marketing/2.png" />
					</p>
				</div>
			</section>
			<section class="page page2">
				<div id="page2">
					<p class="aaa">
						<img src="<%=path%>/images/marketing/3.png" />
					</p>
				</div>
			</section>
			<section class="page page3">
				<div id="page3">
					<p class="aaa">
						<img src="<%=path%>/images/marketing/4.png" />
					</p>
					<p class="bbb">
						<img src="<%=path%>/images/marketing/5.png" />
					</p>
				</div>
			</section>
			<section class="page page4">
				<div id="page4">
					<p class="aaa">
						<img src="<%=path%>/images/marketing/6.png" />
					</p>
					<p class="bbb">
						<img src="<%=path%>/images/marketing/7.png" />
					</p>
					<p class="ccc">
						<img src="<%=path%>/images/marketing/8.png" />
					</p>
				</div>
			</section>
			<section class="page page5">
				<div id="page5">
					<div class="aaa">
						<li><span>姓名</span><input type="text"></li>
						<li><span>电话</span><input type="number"></li>
						<li><span>邮箱</span><input type="text"></li>
					</div>
					<p class="bbb">
						<%-- <img src="<%=path%>/images/marketing/9.png" /> --%>
						<a href="javascript:;">确认提交</a>
					</p>
			
					<ul class="s_footer">
				        
				    </ul>
				</div>
				
			</section>
		</section>
		<div class="arrow" id="arrow">
			<img src="<%=path%>/images/marketing/arrow.png" />
		</div>
		<span id="musicControl"> <a id="mc_play" class="on"
			onclick="play_music2();">    
	<%-- 		<audio id="musicfx" loop="loop" autoplay="autoplay">
                    <source id="music_url" src="<%=path%>/bm/audio/audio.mp3" type="audio/mpeg">
                </audio>  --%>
            <audio id="mp3" loop="loop" autoplay="autoplay"
					src="<%=path%>/mp3/孙子涵-毕业后你不是我的.mp3" ></audio>
		</a>
		</span>
	</section>
	
	<div class="s_popup_delect2" >
        <div class="s_consum" style="line-height:30px;padding:14px 3%;height:80px">
            <p id="dialog_title"><img  style="width:24px;height:24px" src="<%=path%>/images/marketing/s_tick.png" /> </p>
        </div>
    </div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="<%=path%>/js/marketing/adaptational.js"></script>
<script src="<%=path%>/js/marketing/slide.js"></script>
<script src="<%=path%>/js/marketing/script.js"></script>
<script src="<%=path%>/js/marketing/music.js"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="<%=path%>/js/marketing/validation.js"></script>
	<script src="<%=path%>/hplus/js/plugins/sweetalert/sweetalert2.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/marketing/dialog.js"></script>
	 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
	 <script src="<%=path%>/js/system/province-city-area-data.js"></script>
<script type="text/javascript">
    var cid;
    var activity_id;
    var activity_type;
    var type;
    var open_way;
    var ip;
    
    var pics;
    var bg_pics;
    var customer_id;
    var music_url;
    var email_flag=false;
    var weixin_flag=false;
    var weibo_flag=false;
    var job_flag=false;
    var company_flag=false;
    var name;
	var mobile;
	var email;
	var weibo;
	var weixin;
	var job;
	var company;
	 var share_title;
     var share_content;
     var share_pic;
     //判断当前页面是否转发而来
     var transmitTag=0;
     
     var cardId;
 	var openId;
 	var province="";
 	var city="";
 	var district="";
 	var couponBatch="";
 	var activityName="";
 	var taskId="";
 	var sms_batch;
 	var channel_type;
 	var cityId = "";
	$(function(){
		activity_id=getQueryString("activity_id");
		activity_type=getQueryString("type");
		cid=getQueryString("cid");
		ip=returnCitySN["cip"]+','+returnCitySN["cname"];
		if(StringEmpty(getQueryString("isappinstalled"))||StringEmpty(getQueryString("appinstall"))){
			transmitTag=1;
		} else{
			transmitTag=0;
		}
		sms_batch=getQueryString("batch");
		cardId=getQueryString("cardId");
		openId=$.cookie('weixinOpenId');
		channel_type=getQueryString("channel");
		taskId=getQueryString("taskId");
		couponBatch=getQueryString("couponBatch");
		ip=returnCitySN["cip"];
		city = returnCitySN["cname"];
		cityId=getCityCodeByName(city);
		openWay();
		getActivityInfo(activity_id); 
		
	});
	
	//获取活动信息
	function getActivityInfo(activity_id) {
		customer_id= getQueryString("cid");
		cid=getQueryString("cid");
		var url="<%=path%>/activity/ajaxActivityDetail";
		$.post(url, {
			"cid" : cid,
			"id" : activity_id,
		}, function(data) {
			if (data.status == 200) {
				getWeinInfo();
		 		setActivityHtml(data.data); 
			} else {

			}
		});

	}

	function setActivityHtml(data){
		console.log(data);
		share_pic=data.pic;
		share_title=data.title;
		share_content=data.content;
		$("#sharePic").attr("src",share_pic);
		$("shareContent").html(share_content);
		$(document).attr("title",data.name);
		 pics=(data.picUrl).split(",");
		 bg_pics=(data.backgroundPic).split(",");
		 var html1='';
		 for(var i =0;i<pics.length;i++){
			 var index=i+1;
			 var id="#page"+index;
			 if(bg_pics.length == 1){
				 html1+='<section id="page'+index+'" class="page page'+index+'" style="background-image:url('+bg_pics[0]+')"><div>';
			 }else if(bg_pics.length > 1){
				 html1+='<section id="page'+index+'" class="page page'+index+'" style="background-image:url('+bg_pics[i]+')"><div>';
			 }else{
				 html1+='<section id="page'+index+'" class="page page'+index+'"><div>';
			 }
			 html1+='<p class="aaa"><img src="'+pics[i]+'"/></p>';
// 			 if(StringEmpty(bg_pics[i])){
// 				 $(id).css("background-image", "url("+ bg_pics[i]+")");
// 			 }
			 html1+='</div>';
			 
			/*  if(i == pics.length-1){ */
				 /*********************** 文本内容 ******************************/
				/*  html1+='<div style="height:100%;padding:20px;"><textarea style=" width:100%;height:200px;margin-top:50%;text-align:center;padding-top:3%;'+(data.text_info_color!=null &&data.text_info_color!="" &&data.text_info_color!=undefined ? "color:"+data.text_info_color:"color:#F7A2A5" )+'" readonly="readonly";>';
				 html1+=data.description;
				 html1+='</textarea></section>'; */
			 /* } */
			 
			 html1+='</section>';
		 }
		 
		 
		 $("#sliderWrap").html(html1);
		
		 if(StringEmpty(data.commitInfo)){
			 var commit_html='<section class="page page5" ><div id="page5"   '+(bg_pics[0]!=null&&bg_pics[0]!=''&&bg_pics[0]!=undefined?"style=background-image:url("+bg_pics[0]+')':"")+' >';
			 commit_html+='<textarea style=" width:90%;height:200px;margin-top:10%;margin-left:5%;text-align:center;padding:3%;'+(data.text_info_color!=null &&data.text_info_color!="" &&data.text_info_color!=undefined ? "color:"+data.text_info_color:"color:#F7A2A5" )+'" readonly="readonly";>';
			 commit_html+=data.description;
			 commit_html+='</textarea>';
			 commit_html+='<div class="aaa">';
			 //設置提交信息按钮框
	         var commit_info=data.commitInfo.split(",");
	         if(commit_info.length>0){
	        	 for(var i=0;i<commit_info.length;i++){
	 				switch (commit_info[i]) {
	 				case "commit_name":
	 					commit_html+='<li><span>姓名</span><input type="text" id="name_input"></li>';
	 					break;
	 	            case "commit_mobile":
	 	            	commit_html+='<li><span>电话</span><input type="text" id="mobile_input"></li>';
	 					break;
	 				case "commit_email":
	 					email_flag=true;
	 					commit_html+='<li><span>邮箱</span><input type="text" id="email_input"></li>';
	 					break;
	 	            case "commit_weibo":
	 	            	weibo_flag=true;
	 	            	commit_html+='<li><span>微博</span><input type="text" id="weibo_input"></li>';
	 					break;
	 	            case "commit_weixin":
	 	            	weixin_flag=true;
	 	            	commit_html+='<li><span>微信</span><input type="text" id="weixin_input"></li>';
	 					break;
	 	            case "commit_job":
	 	            	job_flag=true;
	 	            	commit_html+='<li><span>职位</span><input type="text" id="job_input"></li>';
	 					break;
	 	            case "commit_company":
	 	            	company_flag=true;
	 	            	commit_html+='<li><span>公司</span><input type="text" id="company_input"></li>';
	 					break;
	 				default:
	 					break;
		 				}
		 			}
		        	commit_html+='</div>';
		 			commit_html+='<p  id="btn_join" class="bbb"><a style="background:'+(data.button_css!=undefined&&data.button_css!="#000000"?data.button_css:"#ffae5e")+'" href="javascript:joinBtn();"><font color=white>'+((data.button_text == undefined||data.button_text == null||data.button_text == "") ? "立即提交" : data.button_text)+'</font></a></p>';
		         }
		        
		 		commit_html+='<ul class="s_footer"></ul></div></section>';
		 	    $("#sliderWrap").append(commit_html); 
		 		
		 		if(StringEmpty(data.weixinQrcode)&&!StringEmpty(data.weiboQrcode)){
					console.log("weixin--->");
					var html_weixin='<li style="width:100%"><img id="weixin_qrcode" src="'+data.weixinQrcode+'" /><p>微信二维码</p></li>';
					$(".s_footer").append(html_weixin); 
				}else if(StringEmpty(data.weixinQrcode)){
					var html_weixin='<li><img id="weixin_qrcode" src="'+data.weixinQrcode+'" /><p>微信二维码</p></li>';
					$(".s_footer").append(html_weixin); 
				}
				
	            if(StringEmpty(data.weibo_qrcode)&&!StringEmpty(data.weixinQrcode)){
	            	console.log("weibo_qrcode");
	            	var html_weibo='<li style="width:100%"><img id="weibo_qrcode" src="'+data.weiboQrcode+'" /><p>微博二维码</p></li>';
					$(".s_footer").append(html_weibo); 
				}else if(StringEmpty(data.weiboQrcode)){
					var html_weibo='<li><img id="weibo_qrcode" src="'+data.weiboQrcode+'" /><p>微博二维码</p></li>';
					$(".s_footer").append(html_weibo); 
				}
		 }

			
		
		
		/*  if(StringEmpty(data.button_css)&&data.button_css!="#000000"){
			console.log("----------->");
			$(".bbb").css("background-color",data.button_css);
		}
		if(StringEmpty(data.button_text))
			   $(".bbb").html(data.button_text);  */
		
		if(StringEmpty(data.backgroundMusic)){
			music_id=data.backgroundMusic;
			getMusicDetail();
		}
		createBrowse();
	}
	  //浏览
	function createBrowse() {
		var url="<%=path%>/activity/ajaxBrowseActivity";
		$.post(url, {
			"cid" : cid,
			"activityId" : activity_id,
			"customerId" : customer_id,
			"browseIp" : ip,
			"openWay" : open_way,
			"transmitTag":transmitTag,
			"smsBatch":sms_batch,
			"cardId":cardId,
			"openId":openId,
			"channelType":channel_type,
			"province":province,
			"city":city,
			"district":district,
			"couponBatch":couponBatch,
			"activityName":activityName,
			"taskId":taskId,
		}, function(data) {
			
		});

	}
	//获取音乐文件信息
	function getMusicDetail(){
		var url = "${pageContext.request.contextPath}/activityMusic/ajaxGetActivityMusicDetail";
		$.post(url, {
			"cid":cid,
			"id" : music_id,
		}, function(data) {
			
			if (data.status =="200") {
				music_url=data.data.url;
				/* $("#music_url").attr("src",music_url); */
				play_music2();
			} else {
				
			}
		});
	}
	
	//立即领取
	/*  $(document).on('click', '#btn_join', function() {
		 
		 name = document.getElementById("name_input").value;
		 mobile = document.getElementById("mobile_input").value;
		 if(email_flag){
			 email = document.getElementById("email_input").value; 
		 }
		 if(weibo_flag){
			 weibo = document.getElementById("weibo_input").value;
		 }
        if(weixin_flag){
       	 weixin = document.getElementById("weixin_input").value;
		 }
       if(job_flag){
       	 job = document.getElementById("job_input").value;
        }
       if(company_flag){
       	company = document.getElementById("company_input").value;
        }
		if(StringEmpty(name)&&StringEmpty(mobile)){
			if(validatemobile(mobile)){
					joinActivity(name,mobile);
			}else{
					showDialog("您输入的手机号码不符合规范");
			}
			}else if(!StringEmpty(name)){
				showDialog("请输入姓名");
			}else{
				showDialog("请输入手机号码");
			}
	 }); */
	 
	function joinBtn() {
		 
		 name = document.getElementById("name_input").value;
		 mobile = document.getElementById("mobile_input").value;
		 if(email_flag){
			 email = document.getElementById("email_input").value; 
		 }
		 if(weibo_flag){
			 weibo = document.getElementById("weibo_input").value;
		 }
        if(weixin_flag){
       	 weixin = document.getElementById("weixin_input").value;
		 }
       if(job_flag){
       	 job = document.getElementById("job_input").value;
        }
       if(company_flag){
       	company = document.getElementById("company_input").value;
        }
		if(StringEmpty(name)&&StringEmpty(mobile)){
			if(validatemobile(mobile)){
					joinActivity(name,mobile);
			}else{
					showDialog("您输入的手机号码不符合规范");
			}
			}else if(!StringEmpty(name)){
				showDialog("请输入姓名");
			}else{
				showDialog("请输入手机号码");
			}
	 }
	
	 //参加活动
		function joinActivity(name,mobile) {
			var url="<%=path%>/activity/ajaxJoinActivity";
			
			var param={
					"cid" : cid,
					"activityId" : activity_id,
					"customerName" : name,
					"customerPhone":mobile,
					"weixin" : weixin,
					"weibo" : weibo,
					"job" : job,
					"company" : company,
					"email" : email,
					"openWay" : open_way,
					"transmitTag":transmitTag,
					"smsBatch":sms_batch,
					"cardId":cardId,
					"channelType":channel_type,
					"province":province,
					"city":city,
					"district":district,
					"couponBatch":couponBatch,
					"taskId":taskId,
				};
			$.post(url, {
				"param":JSON.stringify(param)
				}, function(data) {
						if(data.status==200){
							var customerId=data.data;
							window.location.href = "<%=path%>/view/ui/mobileActivitySuccessPage?activityId="+activity_id+"&cid="+cid+"&customerId="+customerId+"&couponBatch="+couponBatch;
						}else if (data.status=="301"){//用户已参加过活动
                            var customerId=data.data;
                            window.location.href = "<%=path%>/view/ui/mobileActivitySuccessPage?activityId="+activity_id+"&cid="+cid+"&customerId="+customerId+"&couponBatch="+couponBatch+"&join=isJoin";
                        }else{
                            errorDialog(data.message);

						}

			   });
	      }
	 //判断打开途径
    function openWay(){
    	//微信微博
        var browser = {
            versions: function() {
                var u = navigator.userAgent,
                    app = navigator.appVersion;
                return { //移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            }(),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }


        if (browser.versions.mobile) { //判断是否是移动设备打开。browser代码在下面
            var ua = navigator.userAgent.toLowerCase(); //获取判断用的对象

         
            if (browser.versions.ios) {
            	open_way="sms";
            }
            if (browser.versions.android) {
            	open_way="sms";
            }
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                //微信打开
            	open_way="weixin";
            }
            if (ua.match(/WeiBo/i) == "weibo") {
                //微博打开
            	open_way="weibo";
            }
            if(ua.match(/qq/i) =="qq" && ua.match(/MicroMessenger/i) !=
            		"micromessenger") {
            	open_way="qq";
                //qq打开
            }else if(navigator.userAgent.indexOf("MQQBrowser")>-1&& ua.match(/MicroMessenger/i) !=
        		"micromessenger"){
            	open_way="qq";
            }
        } else {
        	open_way="pc";
            //否则就是PC浏览器打开
        }

    
    }
	var play_tag=true;
   function play_music2(){
	    
    	if(play_tag){
    		playMP3(music_url);
    	}else{
    		stopMP3();
    	}
    }
	 
    function playMP3(src) {
		var mp3 = document.getElementById("mp3");
		if (mp3.src.indexOf(src) > 0 || mp3.src.indexOf(encodeURI(src)) > 0) {

		} else {
			mp3.src = src;
			mp3.load();
		}
		mp3.play();
		play_tag=false;
	}

	function stopMP3() {
		var mp3 = document.getElementById("mp3");
		mp3.pause();
		play_tag=true;
	} 
	
    //获取参数
	function getQueryString(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = window.location.search.substr(1).match(reg);
		if (r != null)
			return unescape(r[2]);
		return null;
	}
	
	//判断字符串是否为空
	function StringEmpty(content) {
		if (content == undefined || content == "" || content == null) {
			return false;
		} else {
			return true;
		}
	}
	function showDialog(title){
		$('#dialog_title').html('<img style="width:24px;height:24px" src="<%=path%>/images/marketing/s_tick.png"/>'+title+''); 
		$('.s_popup_delect2,.s_consum').show().delay(2000).fadeOut();
	}
/*  //校验手机号码
	function validatemobile(mobile) {
		var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
		if (mobile.length == 0) {
			showDialog('请输入手机号码！');
			document.form1.mobile.focus();
			return false;
		} else if (mobile.length != 11) {
			showDialog('请输入有效的手机号码！');
			document.form1.mobile.focus();
			return false;
		} else if (!myreg.test(mobile)) {
			showDialog('请输入有效的手机号码！');
			document.form1.mobile.focus();
			return false;
		} else {
			return true;
		}
	}  */
	
	    var timestamp;
	    var signature;
	    var nonceStr;
	    var link_url;
	    var appid;
	    var web_url;
	    function getWeinInfo(){
	    	 web_url = window.location.href.split('#')[0];  
	    	/* web_url = web_url.replace(/\&/g, '%26');  */
	    	/* web_url=encodeURIComponent(web_url); */
	    	var url="<%=path%>/api/auth/share";
			$.post(url, {
				"url" : web_url,
			}, function(data) {
				
				timestamp=data.timestamp;
				signature=data.signature;
				nonceStr=data.nonceStr;
				link_url=data.url;
				var reg = new RegExp("%26","g");
				link_url=link_url.replace(reg,"&");
				appid=data.appId;
				config();
			});
	    }
	    
	    function config(){
	    	wx.config({
		        debug: false,
		        appId: appid,
		        timestamp: timestamp,
		        nonceStr: nonceStr,
		        signature: signature,
		        jsApiList: [
		          'checkJsApi',
		          'onMenuShareTimeline',
		          'onMenuShareAppMessage',
		          'onMenuShareQQ',
		          'onMenuShareWeibo',
		          'hideMenuItems',
		          'showMenuItems',
		      
		        ]
		    });
	    	
	    	
	    	 wx.ready(function () {
	 	    	  // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
	 	    	 /*  document.querySelector('#checkJsApi').onclick = function () {
	 	    	    
	 	    	  }; */
	 	    	  wx.checkJsApi({
	 	    	      jsApiList: [
	 	    	        'getNetworkType',
	 	    	        'previewImage'
	 	    	      ],
	 	    	      success: function (res) {
	 	    	        //console.log(JSON.stringify(res));
	 	    	      }
	 	    	    });
	 	    	  
	 	    	  // 2. 分享接口
	 	    	  // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	   /*  document.querySelector('#onMenuShareAppMessage').onclick = function () { */
	 				    wx.onMenuShareAppMessage({
	 				      title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: encodeURI(share_pic),
	 				      trigger: function (res) {
	 				      },
	 				      success: function (res) {
	 				    	 transmit("time_line");
	 				      
	 				      },
	 				      cancel: function (res) {
	 				      },
	 				      fail: function (res) {
	 				        /* alert(JSON.stringify(res)); */
	 				      }
	                 });
	 	    	
	 	    	   
	 				   wx.onMenuShareQQ({
	 					  title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: share_pic,	 				      
	 				      trigger: function (res) {
	 				      },
	 				      complete: function (res) {
	 				        /* alert(JSON.stringify(res)); */
	 				      },
	 				      success: function (res) {
	 				    	 transmit("time_line");
	 				      
	 				      },
	 				      cancel: function (res) {
	 				      },
	 				      fail: function (res) {
	 				        /* alert(JSON.stringify(res)); */
	 				      }
	 				    });
	 	    	   
	 				   
	 				  wx.onMenuShareTimeline({
	 					  title: share_title,
	 				      desc: share_content,
	 				      link: link_url,
	 				      imgUrl: share_pic,	 
		 	    	      trigger: function (res) {
		 	    	      },
		 	    	      success: function (res) {
		 	    	    	 transmit("qq");
		 	    	      },
		 	    	      cancel: function (res) {
		 	    	      },
		 	    	      fail: function (res) {
		 	    	        alert(JSON.stringify(res));
		 	    	      }
		 	    	    });
	 				   
	 	    	  // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	   /*  
	 	    	 
	 	    	  // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
	 	    	
	 	    	    wx.onMenuShareQQ({
	 	    	      title: '互联网之子',
	 	    	      desc: '在长大的过程中，我才慢慢发现，我身边的所有事，别人跟我说的所有事，那些所谓本来如此，注定如此的事，它们其实没有非得如此，事情是可以改变的。更重要的是，有些事既然错了，那就该做出改变。',
	 	    	      link: 'http://movie.douban.com/subject/25785114/',
	 	    	      imgUrl: 'http://img3.douban.com/view/movie_poster_cover/spst/public/p2166127561.jpg',
	 	    	      trigger: function (res) {
	 	    	        alert('用户点击分享到QQ');
	 	    	      },
	 	    	      complete: function (res) {
	 	    	        alert(JSON.stringify(res));
	 	    	      },
	 	    	      success: function (res) {
	 	    	        alert('已分享');
	 	    	      },
	 	    	      cancel: function (res) {
	 	    	        alert('已取消');
	 	    	      },
	 	    	      fail: function (res) {
	 	    	        alert(JSON.stringify(res));
	 	    	      }
	 	    	    }); */
	 	    	   
	 	    	  });
	    }
	
	    //转发
		function transmit(transmit_way) {
			
			var url="<%=path%>/api/transmit/create";
			$.post(url, {
				"activity_type" : activity_type,
				"cid" : cid,
				"activity_id" : activity_id,
				"transmit_tag": transmitTag,
				"transmit_way": transmit_way,
			
			}, function(data) {
				
				
			});

		} 	 
	
</script>




</html>